<!doctype html>
<html>
<head>
<template source='TPL:common.head_search' load='true' />
<link href="{@G:url.extres}/search/css/search.css?v={@G:version}" rel="stylesheet" />
</head>
<body>
<pw-start/>
<div class="wrap">
<template source='TPL:common.header' load='true' />
	<template source='EXT:search.template.common_header' />
	<div class="main_wrap">
		<div class="main cc">
			<pw-tpl id="searchlist_top"/>
			<div class="grid_3 cc mb20">
				<div class="cm">
					<div class="cw cc" style="margin-left:0;">
						<!--# if ($forums) { #-->
						<div class="forum_info_wrap">
							<!--# foreach ($forums as $key => $value) { 	#-->
							<div class="forum_info_box cc">
								<!--# if($value['icon']) { #-->
								<div class="banner"><a href="{@url:bbs/thread/run?fid=$key}" target="_blank"><img src="{@Pw::getPath($_item['icon'])}" alt="forumlogo" width="100" height="100" /></a></div>
								<!--# } #-->
								<div class="name">
									<!--# if ($loginUser->isExists() && $value['type'] != 'category') { #-->
									<span class="fr">
										<!--# if (!in_array($key, $joinForums)) { #-->
										<a href="{@url:bbs/forum/join?fid=$key}" data-role="join" data-fid="{$key}" class="core_follow J_forum_join J_qlogin_trigger">加入版块</a>
										<!--# } else { #-->
										<a href="{@url:bbs/forum/quit?fid=$key}" data-role="quit" data-fid="{$key}" class="core_unfollow J_forum_join">已加入<span>&nbsp;&nbsp;|&nbsp;&nbsp;取消</span></a>
										<!--# } #-->
									</span>
									<!--# } #-->
									<h3><a href="{@url:bbs/thread/run?fid=$key}" target="_blank">{$value['name']|html}</a></h3>
								</div>
								<div class="num">
									<ul class="cc">
										<li>今日：<em>{$value['todayposts']}</em></li>
										<li>主题：<em>{$value['threads']}</em></li>
										<li>总帖：<em><!--#echo $value['threads'] + $value['posts'];#--></em></li>
									</ul>
								</div>
								<!--# if ($value['manager']) { #-->
								<div class="moderator">
									版主：
									<!--# foreach($value['manager'] as $name) { #-->
											<a class="J_user_card_show" data-username="{$name}" href="{@url:space/index/run?username=$name}" target="_blank">{$name} </a>
									<!--# } #-->
								</div>
								<!--# } #-->
								<!--# if ($value['descrip']) { #-->
								<div class="notice">
									<span class="J_forum_intro">版块简介：{$value['descrip']|html}</span>
								</div>
								<!--# } #-->
							</div>
							<!--# } #-->
						</div>
						<div class="p15">
							<page tpl='TPL:common.page' page='$page' count='$count' per='$perpage' url='app/search/index/user' args='$args'/>
						</div>
						<!--# } elseif ($args['keywords']) { #-->
						<div class="not_content">啊哦，没有找到与“<font class="org">{$args['keywords']}</font>”相关的内容，请尝试换个词试试！</div>
						<!--# } #-->
					</div>
				</div>
				<div class="sd">
					<template source='EXT:search.template.common_record' />
				</div>
			</div>
			

			<pw-tpl id="searchlist_bottom"/>
		</div>
	</div>
<template source='TPL:common.footer' load='true' />
</div>
<script>
var FID = '{$pwforum->fid}';
Wind.use('jquery', 'global', function(){

<!--# if ($loginUser->isExists()) { #-->
	Wind.js(GV.JS_ROOT +'pages/bbs/threadForumManage.js?v='+ GV.JS_VERSION);

	var JOIN_URL = "{@url:bbs/forum/join}",		//版块加入
			QUIT_URL = "{@url:bbs/forum/quit}",		//版块退出
			lock = false;

	//ie6 hover显示版块退出
	if($.browser.msie && $.browser.version < 7) {
		$('a.J_forum_join').hover(function(){
			if($(this).data('role') == 'quit') {
				$(this).children().show();
			}
		}, function(){
			if($(this).data('role') == 'quit') {
				$(this).children().hide();
			}
		});
	}

	//版块加入 退出
	$('a.J_forum_join').on('click', function(e){
		e.preventDefault();
		var $this = $(this),
				role = $this.data('role'),
				url = (role == 'join' ? JOIN_URL : QUIT_URL);

		if(lock) {
			return false;
		}
		lock = true;

		//global.js
		Wind.Util.ajaxMaskShow();

		$.post(url, {fid : $this.data('fid')}, function(data) {
			//global.js
			Wind.Util.ajaxMaskRemove();

			if(data.state == 'success') {
				if(role == 'join') {
					$this.html('已加入<span>&nbsp;&nbsp;|&nbsp;&nbsp;取消</span>').removeClass('core_follow').addClass('core_unfollow').data('role', 'quit');
				}else{
					$this.html('加入版块').removeClass('core_unfollow').addClass('core_follow').data('role', 'join');
				}
			}else if(data.state == 'fail') {
				//global.js
				Wind.Util.resultTip({
					error : true,
					msg : data.message[0],
					elem : $this,
					follow : true
				});
			}
			lock = false;
			
		}, 'json');
	});
<!--# } #-->

});
</script>
<pw-end/>
</body>
</html>